import Vue from 'vue'
import VueRouter from 'vue-router'
import movie from '../views/movie.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/welcome'
  },
  {
    path: '/welcome',
    name: 'welcome',
    component: () => import( '../views/welcome.vue')
  },
  {
    path: '/movie',
    name: 'movie',
    component: movie
  },
  {
    path: '/moviedetail',
    name: 'moviedetail',
    component: () => import( '../views/moviedetail.vue')
  },
  {
    path: '/music',
    name: 'music',
    component: () => import( '../views/music.vue')
  },
  {
    path: '/musicdetail',
    name: 'musicdetail',
    component: () => import( '../views/musicdetail.vue')
  },
  {
    path: '/*',
    component: () => import( '../views/Error.vue')
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
